Hello everyone,

As part of a University project, I'm developing a RTYPE-like game. Although, we are pretty much free to do it as we like, there are Platform and Library constraints. For example, the program must work in both Unix and Windows. For the server, it has to be multi-threaded and no libraries are allowed (So we have to write our own, Thread Abstraction library, Socket library, etc).

Here are my questions:

[1] The game is multiplayer based. You have have up to 4 players in an instance of a game. Is it possible for the server to handle the collisions between players/enemies? I'm having a hard time finding out if it is possible or not, because I don't see how the server can have a world synchronized with that of the players. (The same time-step / etc). Is it even worth doing or should the client handle his own collisions and notify the server when there is one? (So that the server can dispatch the message to other clients). Any good articles on the topic?

[2] Communication is UDP only. There will be one listening socket. Since each instance of a game will probably be a different thread, when I receive socket information, what is the best way to dispatch it to the other threads? I see two solutions:
- Create a buffer for each instance of a game. When the main loop receives info it locks the buffer, puts the information there, and unlocks it. The thread is then notified of available info (thread_cond? Something more elegant?) and locks/copies/erases/unlocks the buffer.
- Create localhost sockets, for each instance of a game. The main loop will get information from the main UDP socket and dispatches it to the new "local" socket that is different for each instance.
Anything I've missed?

Thank you for your time.